import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/major/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/major/detail',
    method: 'get',
    params: {
      id,
    }
  })
}
export const remove = (ids) => {
  return request({
    url: '/api/major/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}
export const add = (row) => {
  return request({
    url: '/api/major/save',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/major/update',
    method: 'post',
    data: row
  })
}

// 获取DCS列表
export const getDCSList = (current, size, params) => {
  return request({
    url: '/api/configuration/dcsdatasiteinfo/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

// 获取所属部门
export const getDeptList = (tenantId) => {
  return request({
    url: '/api/blade-system/dept/tree',
    method: 'get',
    params: {
      tenantId
    }
  })
}

// 获取安全负责人信息
export const getAnQuanFzrLinkInfo = (aqfzraqfzr) => {
  return request({
    url: '/api/major/getAnQuanFzrLinkInfo',
    method: 'get',
    params: {
      aqfzraqfzr
    }
  })
}

// 获取区域负责人信息
export const getQuYuFzrLinkInfo = (qyfzr) => {
  return request({
    url: '/api/major/getQuYuFzrLinkInfo',
    method: 'get',
    params: {
      qyfzr
    }
  })
}

// 统计危险类型下的危险源个数（危险源趋势分布图）
export const getCountWxylx = () => {
  return request({
    url: '/api/major/getCountWxylx',
    method: 'get',
  })
}

export const getCameraBinding = (current, size, params) => {
  return request({
    url: '/api/major/getCameraBindingPage',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const bindingCamera = (ids, id) => {
  return request({
    url: '/api/major/bindingCamera',
    method: 'post',
    params: {
      ids,
      id
    }
  })
}

export const getCameraBindingList = (businessId, businessType) => {
  return request({
    url: '/api/major/getCameraBindingList',
    method: 'get',
    params: {
      businessId,
      businessType
    }
  })
}

// 巡检记录列表
export const getPatrolRecordsList = (current, size, params) => {
  return request({
    url: '/api/major/getPatrolRecordList',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  })
}

